package com.zyong.design.pattern.strategy.case2;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: zyong-design-pattern
 * @ClassName: ReceiptHandleStrategyFactory
 * @author: zyong
 * @create: 2024-04-14 01:02
 */
public class ReceiptHandleStrategyFactory {
    private static Map<String, ReceiptHandleStrategy> strategyMap = new HashMap<String, ReceiptHandleStrategy>() {{
        put("Mt1011", new Mt1011ReceiptHandleStrategy());
        put("Mt2101", new Mt2101ReceiptHandleStrategy());
    }};

    /**
     * 获取ReceiptHandleStrategy对象实例
     * @param receiptType
     * @return
     */
    public static ReceiptHandleStrategy getReceiptHandleStrategy(String receiptType) {
        return strategyMap.get(receiptType);
    }
}
